package com.example.test.exception;

import com.example.test.common.CodeMsg;
import lombok.Data;
import lombok.extern.slf4j.Slf4j;

@Slf4j
@Data
public class BusinessException extends RuntimeException {
	private int code;
	private String message;
	private Object data;


	public BusinessException(CodeMsg codeMsg) {
		this.code = codeMsg.getCode();
		this.message = codeMsg.getMessage();
	}

	public BusinessException(int code, String message) {
		this.code = code;
		this.message = message;
	}
}
